package com.esl.action;

import java.util.Map;
import org.apache.struts2.json.annotations.JSON;

import com.esl.dto.admin.PageInfo_Dto;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class CommonAction extends ActionSupport{

	private Map<String, Object> session;

	private String jump_url = "";

	private PageInfo_Dto pageInfo_Dto;

	/*-----------------------------------*/
	public String execute() {

		return jump_url;
	}

	/*-----------------------------------*/
	public int getUid() {
		return session.get("uid") == null ? -1 : Integer.parseInt(session.get(
				"uid").toString());
	}

	public String getName() {
		return session.get("name") == null ? "" : session.get("name")
				.toString();
	}

	/*-----------------------------------*/
	public CommonAction() {
		super();
		this.session = ActionContext.getContext().getSession();
	}

	public PageInfo_Dto getPageInfo_Dto() {
		return pageInfo_Dto;
	}

	public void setPageInfo_Dto(PageInfo_Dto pageInfo_Dto) {
		this.pageInfo_Dto = pageInfo_Dto;
	}

	@JSON(serialize = false)
	public Map<String, Object> getSession() {
		return session;
	}

	public void setSession(Map<String, Object> session) {
		this.session = session;
	}

	@JSON(serialize = false)
	public String getJump_url() {
		return jump_url;
	}

	public void setJump_url(String jump_url) {
		this.jump_url = jump_url;
	}

}